<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:birt="http://jsf4birt.components"
	template="../templates/template.xhtml">
	<ui:define name="body">

	<h:outputText value="#{indicatorsMonitoringController.onload}"></h:outputText>

	<h:form id="x">
	<div align="center">
	<rich:panel style="background: transparent">
		<h:panelGrid columns="6" width="100%" >
			<h:outputText value="Departameto"/>
			<h:selectOneMenu value="#{indicatorsMonitoringController.departamento}">
				<f:selectItem itemLabel="--seleccione--"  itemValue="00"/>
				<f:selectItems value="#{indicatorsMonitoringController.listaDep}"/>
				<a4j:support event="onchange" action="#{indicatorsMonitoringController.cargaProvincias}" reRender="cmbProv,cmbDist,cmbSede"/>
			</h:selectOneMenu>
			<h:outputText value="Provincia" />
			<h:selectOneMenu id="cmbProv" value="#{indicatorsMonitoringController.provincia}" style="font-family:Verdana, Arial, Helvetica, sans-serif ;font-size: 14px; width:240px ;">
				<f:selectItem itemLabel="--seleccione--"  itemValue="00"/>
				<f:selectItems value="#{indicatorsMonitoringController.listaProv}"/>
				<a4j:support event="onchange" action="#{indicatorsMonitoringController.cargaDistrito}" reRender="cmbDist"/>
			</h:selectOneMenu>
			<h:outputText value="Distrito" />
			<h:selectOneMenu id="cmbDist" value="#{indicatorsMonitoringController.distrito}">
				<f:selectItem itemLabel="--seleccione--"  itemValue="00"/>
				<f:selectItems value="#{indicatorsMonitoringController.listaDis}"/>
			</h:selectOneMenu>
			<rich:spacer height="10px"/><rich:spacer/><rich:spacer/><rich:spacer/><rich:spacer/><rich:spacer/>
			<h:outputText value="Sede" />
			<h:selectOneMenu id="cmbSede" value="#{indicatorsMonitoringController.sede}">
				<f:selectItem itemLabel="--seleccione--"  itemValue="000"/>
				<f:selectItems value="#{indicatorsMonitoringController.listaSede}"/>
			</h:selectOneMenu>
			
			<h:outputText value="Ano" />
			<h:inputText value="#{indicatorsMonitoringController.anio}" />
			<h:outputText value="Mes" />
			<h:inputText value="#{indicatorsMonitoringController.mes}" />
			
		</h:panelGrid>
		<rich:spacer height="30px"/>
		<a4j:commandButton value="Generar Reporte"
			action="#{indicatorsMonitoringController.recargaLista()}" reRender="panelReport"/>
		</rich:panel>
		</div>
		
		
		<rich:spacer height="20px" />
		<div align="center">
		<h:panelGroup id="panelReport">
			<a4j:outputPanel style="visibility:hidden">
			<birt:birtWrapper
				reportDesign="/reports/reportCoberturaAtencion.rptdesign"
				id="report" />
				</a4j:outputPanel>
		</h:panelGroup>
		</div>
	</h:form>
	<h:panelGrid columns="3" width="100%" style="">
		<div align="center">
			<a href="javascript: void(0)" onclick="JSF4Actuate.pdf('x:report')">PDF</a>

			<a href="javascript: void(0)" onclick="JSF4Actuate.xls('x:report')">XLS</a>

			<a href="javascript: void(0)" onclick="JSF4Actuate.doc('x:report')">DOC</a>
		</div>
	</h:panelGrid>
	<a4j:status  id="idwait" onstart="#{rich:component('wait')}.show()" 
	 						onstop="#{rich:component('wait')}.hide()"  />
				<rich:modalPanel id="wait" autosized="true" width="100" height="40" moveable="false" resizeable="false" >
					<h:graphicImage value="../images/spinner.gif" />
					<h:outputText value="Procesando..." />
				</rich:modalPanel>
</ui:define>

</ui:composition>